Admin config form now uses bootstrap_form_for

jamesperet 9 years ago
parent
commit
858464858c
1 changed files with 12 additions and 10 deletions
  1. 12 10
      app/views/admin_panel/site_config.html.erb

+ 12 - 10
app/views/admin_panel/site_config.html.erb

@@ -6,22 +6,24 @@
6 6
 		</div>
7 7
 		<%= bootstrap_flash %>
8 8
 		<div class="media thumbnail" style="padding: 10px; padding-bottom: 5px;">
9
-			<%= simple_form_for(@config, :url => config_update_path, :method => 'POST', :html => { class: ''}) do |f| %>
10
-			  <%= f.error_notification %>
9
+			<%= bootstrap_form_for(@config, :url => config_update_path, :method => 'POST') do |f| %>
10
+			  <%= f.alert_message "Please fix the errors below." %>
11 11
 
12 12
 			  <div class="form-inputs">
13
-			    <%= f.input :website_name, :label => (t 'admin_panel.website_name'), :input_html => {:class => 'input-large'} %>
14
-			    <%= f.input :tagline, :label => (t 'admin_panel.tagline'), :input_html => { :class => 'input-xxlarge'} %>
15
-			    <%= f.input :default_language, collection: ["en", "pt-BR"], prompt:"Select default language",  :label => (t 'admin_panel.default_language'), hint: ("<i>* "+(t "admin_panel.language_hint")+"</i>").html_safe %>
16
-			    <%= f.input :contact_email, :label => (t 'admin_panel.contact_email'), :input_html => {:class => 'input-large'} %>
17
-			    <%= f.input :maintenance_mode, :label => (t 'admin_panel.maintenance_mode') %>
18
-			    <%= f.input :maintenance_title, :label => (t 'admin_panel.maintenance_title') %>
19
-			    <%= f.input :maintenance_message, :label => (t 'admin_panel.maintenance_message'), :input_html => {:class => 'input-large'}  %>
13
+			    <%= f.text_field :website_name, :label => (t 'admin_panel.website_name'), class:'input-xlarge' %>
14
+			    <%= f.text_field :tagline, :label => (t 'admin_panel.tagline'), class: 'input-xxlarge' %>
15
+			    <%= f.select :default_language, ["en", "pt-BR"],  :label => (t 'admin_panel.default_language'), help: ("<i>* "+(t "admin_panel.language_hint")+"</i>").html_safe %>
16
+			    <%= f.email_field :contact_email, :label => (t 'admin_panel.contact_email'), class:'input-xlarge' %>
17
+			    <%= f.form_group :maintenance_mode do %>
18
+			    		<%= f.check_box :maintenance_mode, :label => (t 'admin_panel.maintenance_mode') %>
19
+			    <% end %>
20
+			    <%= f.text_field :maintenance_title, :label => (t 'admin_panel.maintenance_title'), class:'input-xlarge' %>
21
+			    <%= f.text_area :maintenance_message, :label => (t 'admin_panel.maintenance_message'), class:'input-block-level'  %>
20 22
 
21 23
 			  </div>
22 24
 
23 25
 			  <div class="form-actions" style="margin-left: -10px; margin-right: -10px; margin-bottom: -30px;">
24
-			    <%= f.button :submit, (t 'admin_panel.update_config_btn'), :class => 'btn btn-success' %>
26
+			    <%= f.submit (t 'admin_panel.update_config_btn'), class: 'btn btn-success' %>
25 27
 			  </div>
26 28
 			<% end %>
27 29
 		</div>